abstract class $GRAPH{NTP<$HASH,ETP< $EDGE{NTP}} < $ELT{NTP}, $STR
****
A generic graph, consisting of a bunch of nodes and edges. There is no committment as to the meaning of the edges Every node has some edges which associate it with a set of neighbors This generic graph does not have the modification operations Design note:
___The_reason_for_not_having_the_modification_operations_is_that
___it_is_hard_to_work_on_a_general_graph_without_knowing_whether_it
___has_directed_or_undirected_edges
Acknowledgement:
___Discussions_with_the_Karla_folk,_particularly_Wolf,_helped
___elucidate_some_of_the_confusion_between_directed_and_undirected_
___graphs


Ancestors
$STR $ELT{_} $ELT

Descendants
$RO_UGRAPH{_} $UGRAPH{_} UGRAPH{_} UGRAPH_INCL{_}
$RO_DIGRAPH{_} FILTERGRAPH_DIGRAPH_VIEW{_,_} FILTERGRAPH_DIGRAPH_VIEW{_} $DIGRAPH{_}
DIGRAPH_REV_DIGRAPH_VIEW{_} DIGRAPH_INCL{_} DIGRAPH_REV_DIGRAPH_VIEW{_,_} DIGRAPH{_}
LBLD_DIGRAPH{_,_,_} WTD_DIGRAPH{_,_} $LBLD_DIGRAPH{_,_,_} RO_DIGRAPH_INCL{_}



Public


Features
adjacent!(once n: NTP): NTP;
**** This corresponds more closely to the notion of neighbors in an undirected graph. In the case of a directed graph, the neighbors will be the set of outgoing nodes. In other words, by going through all nodes and their adjacent nodes we can construct all the edges in the graph without duplication.
copy: $GRAPH{NTP,ETP};
**** Return a copy of the graph
edge!: ETP;
**** Yield all the edges in the graph
has_edge(e: ETP): BOOL;
**** Return true if this graph has the edge "e"
has_node(n: NTP): BOOL;
**** Return true if this graph has the node "n"
is_empty: BOOL;
**** Return true if there are no nodes in the graph
n_adjacent(n: NTP): INT;
**** Return the number of nodes that are adjacent to "n". See the note at "adjacent!"
n_edges: INT;
**** Return the number of edges in the graph
n_nodes: INT;
**** Return the number of nodes in the graph
node!: NTP;
**** Yield all the nodes in the graph

The Sather Home Page